#ifndef RTSPDECODERTHREAD_H
#define RTSPDECODERTHREAD_H

#include <QThread>
#include <QImage>
#include <QString>

#include "Rtsp_Decod.h" // 假设这是你的解码类文件

class RtspDecoderThread : public QThread
{
    Q_OBJECT
public:
    explicit RtspDecoderThread(QObject *parent = nullptr);
    ~RtspDecoderThread();

    void setUrl(const QString &url);
    bool openStream();
    void closeStream();

signals:
    void newFrame(const QImage &frame);

private slots:
    void decodeLoop();

private:
    QString rtspUrl;
    Rtsp_Decod *decoder;
    bool isRunning;
};

#endif // RTSPDECODERTHREAD_H
